import java.time.LocalDate;
import java.util.ArrayList;

public class Main {
    public static  void main(String [] argc){
        ArrayList<Student> students = new ArrayList<>();
        ArrayList<Course> Courses = new ArrayList<>();
        ArrayList<StudentAndCourse> StudentAndCourse = new ArrayList<>();

        students.add(new Student(1, "张三", LocalDate.of(2000, 1, 1), true));
        students.add(new Student(2, "李四", LocalDate.of(2000, 2, 1), true));
        students.add(new Student(3, "王五", LocalDate.of(2000, 3, 1), true));

        Courses.add(new Course(1,"语文"));
        Courses.add(new Course(2,"数学"));
        Courses.add(new Course(3,"英语"));

        StudentAndCourse.add(new StudentAndCourse(1,1,1,80));
        StudentAndCourse.add(new StudentAndCourse(2,1,2,85));
        StudentAndCourse.add(new StudentAndCourse(3,2,2,90));
        StudentAndCourse.add(new StudentAndCourse(4,3,3,80));

        System.out.println(students);
        System.out.println(Courses);
        System.out.println(StudentAndCourse);


        int sid = StudentAndCourse.get(1).getSid();
        int cid = StudentAndCourse.get(1).getCid();
        double score = StudentAndCourse.get(1).getScore();

        String sname="";
        String cname="";

        for (Student student : students) {
            if (student.getId() == sid) {
                sname = student.getName();
            }
        }

        for (Course cours : Courses) {
            if (cours.getId() == cid) {
                cname = cours.getName();
            }
        }

        System.out.println(sname+"("+sid+")  "+cname+"("+cid+") : "+score);

        //ToDO
        /*
        1)  输出某学生的所有课程成绩和平均分；
        2） 统计输出课程的平均分
        3） 查找某学生某课程的成绩
        */


    }
}
